-
Notifications
You must be signed in to change notification settings - Fork 303
[release-1.13] 🐛 fix: use machine's .spec.failureDomain with fallback to vspheremachine's .spec.failureDomain if not defined #3588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @jcpowermac. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
/ok-to-test |
controllers/vspherevm_controller.go
Outdated
if failureDomain != "" { | ||
vsphereDeploymentZone := &infrav1.VSphereDeploymentZone{} | ||
if err := r.Client.Get(ctx, apitypes.NamespacedName{Name: *failureDomain}, vsphereDeploymentZone); err != nil { | ||
return reconcile.Result{}, errors.Wrapf(err, "failed to get VSphereDeploymentZone %s", *failureDomain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return reconcile.Result{}, errors.Wrapf(err, "failed to get VSphereDeploymentZone %s", *failureDomain) | |
return reconcile.Result{}, errors.Wrapf(err, "failed to get VSphereDeploymentZone %s", failureDomain) |
controllers/vspherevm_controller.go
Outdated
return ctrl.Result{}, err | ||
} | ||
|
||
failureDomain := machine.Spec.FailureDomain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failureDomain := machine.Spec.FailureDomain | |
failureDomain := ptr.Deref(machine.Spec.FailureDomain, "") |
… to vspheremachine's .spec.failureDomain if not defined This commit sets failureDomain string defaulting to `machine.Spec.FailureDomain`. If failureDomain is an empty string then `vsphereMachine.Spec.FailureDomain` is checked for nil, if defined `failureDomain` is set to `vsphereMachine.Spec.FailureDomain`. This resolves an issue where virtual machines are not placed within vm-host groups in a timely manner causing misplacement in the topology.
4ba6045
to
c183af6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
LGTM label has been added. Git tree hash: abf773c73052800c5afa295673d3f65e675cabc9
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrischdi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherry-pick release-1.12 |
@chrischdi: once the present PR merges, I will cherry-pick it on top of In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@chrischdi: new pull request created: #3590 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Manual cherry-pick of #3576
This commit sets failureDomain string defaulting to
machine.Spec.FailureDomain
. If failureDomainis an empty string then
vsphereMachine.Spec.FailureDomain
is checked for nil, if definedfailureDomain
is set tovsphereMachine.Spec.FailureDomain
.This resolves an issue where virtual machines are not placed within vm-host groups in a timely
manner causing misplacement in the topology.